﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
//using MGConsultingModel;
using System.ServiceModel.Activation;
//using MGConsulting.DataServices;

// NOTE: If you change the class name "PublicService" here, you must also update the reference to "PublicService" in Web.config.
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class PublicService : IPublicService
{
         
    public IList<Company> GetAllCompanies()
    {
        using (var context = new MGConsultingBODataContext())
        {
            return context.Companies.ToList();
        }
        
    }

    public IList<Methodology> GetAllMethodologyByCompanyId(int companyId)
    {
        using (var context = new MGConsultingBODataContext())
        {
            return context.Methodologies.Where(m => m.CompanyId == companyId).ToList();
        }
    }

    public IList<Roadmap> GetAllRoadMapByMethodologyId(int methodologyId)
    {
        using (var context = new MGConsultingBODataContext())
        {
            return context.Roadmaps.Where(r => r.MethodologyId == methodologyId).ToList();
        }
    }

    public IList<Template> GetAllTemplateByMethodologyId(int methodology)
    {
        var list = new List<Template>();
        return list;
    }
}


